package com.share.design.builder.example01;

/**
 * @author caifan
 * @since 2022/10/20
 */
public class ConcreteBuilder implements Builder{

    private int partA;
    private String partB;
    private int partC;

    @Override
    public void buildPartA(int partA) {
        this.partA = partA;
    }

    @Override
    public void buildPartB(String partB) {
        this.partB = partB;
    }

    @Override
    public void buildPartC(int partC) {
        this.partC = partC;
    }

    @Override
    public Product getResult() {
        return new Product(partA, partB, partC);
    }

    @Override
    public String toString() {
        return "ConcreteBuilder{" +
                "partA=" + partA +
                ", partB='" + partB + '\'' +
                ", partC=" + partC +
                '}';
    }
}
